package com.mybatisplus.utils;

import com.mybatisplus.pojo.User;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class ResultOBJ {
    // getter和setter方法
    private int code;
    private String message;
    private User data;


    // 构造函数
    public ResultOBJ(int code, String message, User data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public ResultOBJ(int code, String message) {
        this.code = code;
        this.message = message;
    }


    public static final ResultOBJ ADD_SUCCESS = new ResultOBJ(SYSConstant.CODE_SUCCESS, SYSConstant.ADD_SUCCESS);

    public static final ResultOBJ ADD_ERROR = new ResultOBJ(SYSConstant.CODE_ERROR, SYSConstant.ADD_ERROR);

    public static final ResultOBJ UPDATE_SUCCESS = new ResultOBJ(SYSConstant.CODE_SUCCESS, SYSConstant.UPDATE_SUCCESS);

    public static final ResultOBJ UPDATE_ERROR = new ResultOBJ(SYSConstant.CODE_ERROR, SYSConstant.UPDATE_ERROR);

    public static final ResultOBJ DELETE_SUCCESS = new ResultOBJ(SYSConstant.CODE_SUCCESS, SYSConstant.DELETE_SUCCESS);

    public static final ResultOBJ DELETE_ERROR = new ResultOBJ(SYSConstant.CODE_ERROR, SYSConstant.DELETE_ERROR);

    public static final ResultOBJ LOGIN_SUCCESS = new ResultOBJ(SYSConstant.CODE_SUCCESS, SYSConstant.LOGIN_SUCCESS);

    public static final ResultOBJ LOGIN_ERROR = new ResultOBJ(SYSConstant.CODE_ERROR, SYSConstant.LOGIN_ERROR);

}